package cn.com.ejiakanghu.dto;

import org.linlinjava.litemall.db.domain.AgedmallHospitalSendSelfLocation;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wj
 * @date 2022/1/20 14:03
 */
public class OrderHospitalDeliverySelfLocationData {

    private Long id;

    private String name;

    private Integer free;

    private String desc;

    private String image;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getFree() {
        return free;
    }

    public void setFree(Integer free) {
        this.free = free;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public OrderHospitalDeliverySelfLocationData(Long id, String name, Integer free, String desc, String image) {
        this.id = id;
        this.name = name;
        this.free = free;
        this.desc = desc;
        this.image = image;
    }

    public OrderHospitalDeliverySelfLocationData(AgedmallHospitalSendSelfLocation selfLocation) {
        this.id = selfLocation.getId();
        this.name = selfLocation.getSelfLocationName();
        this.free = selfLocation.getFreeFlag();
        this.desc = selfLocation.getLocationRemark();
        this.image = selfLocation.getLocationImgs();
    }

    public OrderHospitalDeliverySelfLocationData() {
    }

    public static List<OrderHospitalDeliverySelfLocationData> transfToLocationData(List<AgedmallHospitalSendSelfLocation> selfLocationList){
        List<OrderHospitalDeliverySelfLocationData> locationList=new ArrayList<>();
        for (int i = 0; i < selfLocationList.size(); i++) {
            OrderHospitalDeliverySelfLocationData selfLocationData=new OrderHospitalDeliverySelfLocationData(selfLocationList.get(i));
            locationList.add(selfLocationData);
        }
        return locationList;
    }
}
